Skip to content

fix(WO20): close the parse-parity harness residual (412/435 -> 435/435, #285) - #291

Merged
ronaldtse merged 1 commit into
mainfrom
wo20-divergences-maps
Nov 16, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
wo20-divergences-maps

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

Closes the WO20 order-of-attack on #285: all three documented divergence kinds resolved; harness now 435/435, zero divergence kinds (baseline 412/435; 826 rows).

Per-kind outcome

  1. item-value (4) — alalc-ell-Grek-Latn-2010 only. Not a wrong value on either side: the rule writes after "Ν" before "Κ", ts preserves written order, while the py SubRule model stores the four constraint kinds as named fields, so positionally compared rows swapped both kinds and values. Resolved by the constraints rule below.
  2. constraints (144) — single pattern: constraint written order vs py's fixed-field model. The four kinds are simultaneous lookarounds; written order carries no semantics. orderConstraints now projects BOTH parsers onto the fixed before/after/not_before/not_after order (stable within a kind). One-sided kinds, duplicated kinds (ts keeps every copy, py keeps the last), and value differences still diverge — none exist in the corpus (checked; the 286 ordering rows hid none).
  3. item-kind (678) — three sub-classes, all mechanically reconcilable:
    • 138 ordering-induced positional swaps — resolved with the constraints rule.
    • 493 none vs "" — both runtimes lower none to the empty string at their compile layers (ts converter.ts case "none" → StringItem(""), compile-item.ts none: {re:"",literal:""}; py actions.py "converter parity"). Canonical form is the shared lowering; py cannot represent none distinctly.
    • 47 any_character fn-vs-alias — ts actions.ts lowers the any_char literal to a function atom, py to AliasItem; both compile through the stdlib-alias path with re: "." (ts converter.ts keeps the alias path; py items.py ALIAS_COMPILED). Canonical form is the shared lowering.

Residual: none. No .parg edits; no parser or model changes; every rule is stated in-code and in new §D of docs/parity/README.md with file:line citations so a future reader can re-derive it.

Gates

  • Harness: 435/435, 0 kinds (was 412/435, 3 kinds / 826 rows).
  • py-vs-py driver (--hand-rev 7a84260): canonical 432/435, raw 432/435 — unchanged, gate held.
  • py rs-golden (GOLDEN_ROOT=~/src/interscript): 1 passed, zero-delta.
  • ts parser-parity (fresh clone off origin/main): parse-all-isc 428/428, end-to-end.test.ts green.
  • maps-CI ruby parse gate (local replica, fresh ruby clone): 435/435.

No interscript-ruby (py normalizer) change was required — the entire residual lived in the canonical projection, which the py-vs-py driver already shared.

Test plan

  • node scripts/parse-parity.mjs --ts-root <ts> --py-root <ruby> → 435/435, zero kinds
  • python scripts/parse_parity_py.py --hand-rev 7a84260 → canonical 432/435, raw 432/435
  • pytest interscript-py/tests/test_golden_capture.py → 1 passed
  • ts CI parity jobs (parse-all + end-to-end) green locally

#285)

The audit baseline's 826 divergence rows (item-kind 678, constraints
144, item-value 4) were all canonical-projection artifacts, not parser
bugs. State each class's shared lowering in the harness normalizer:

- constraints: project BOTH parsers onto the fixed before/after/
  not_before/not_after kind order (written order between simultaneous
  lookarounds carries no semantics; py's SubRule model stores four
  named fields). One-sided kinds, duplicated kinds, and value
  differences still diverge.
- none to "": both runtimes lower identically (ts converter.ts case
  "none" -> StringItem(""); py actions.py "converter parity").
- any_character -> stdlib alias: both runtimes compile it through the
  alias path (ts converter.ts keeps the alias path, re: "."; py
  AliasItem + ALIAS_COMPILED re: ".").

Gates: harness 435/435 zero kinds; py-vs-py driver canonical 432/435
and raw 432/435 (hand rev 7a84260, unchanged); py rs-golden zero-delta;
ts parse-all 428/428 + end-to-end green. No .parg edits, no parser or
model changes. Section D added to docs/parity/README.md with the rules
and their code citations.
@ronaldtse
ronaldtse merged commit b3bfe30 into main Nov 16, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant